<template>
	<view class="padd">
		<view class="newsTit">{{newsInfo.title}}</view>
		<view class="comMod addTime">{{newsInfo.addTime}}</view>
		<view class="content ql-editor">
			<jyf-parser :html="newsInfo.content" :selectable="true"></jyf-parser>
		</view>
		<view class="comMod viewNum">浏览次数：{{newsInfo.viewNum}}次</view>
		<view></view>
	</view>
</template>

<script>
	import { getZzNewsDet } from '@/api/news/index'
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	export default {
		components:{
			jyfParser
		},
		data(){
			return{
				detId:0,
				newsInfo:null
			}
		},
		onLoad(options){
			this.detId = options.detId;
			this.loadZzNewsDet();
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline'],
			})
		},
		methods:{
			onShareAppMessage(res){
				let imageUrl = this.newsInfo.headImg == '' ? this.shareDefNews :  this.cloudUrl + this.newsInfo.headImg;
				return{
					title:this.newsInfo.title + '新闻详情',
					imageUrl
				}
			},
			loadZzNewsDet(){
				let field = { id:this.detId }
				getZzNewsDet(field).then(res=>{
					this.newsInfo = res.data.datas;
				}).catch(err=>{
					
				})
			}
		}
	}
</script>
<style>
	.ql-indent-1 {
	  padding-left: 0px !important;
	  text-indent: 1em !important;
	}
	
	.ql-indent-2 {
	  padding-left: 0px !important;
	  text-indent: 2em !important;
	}
	
	.ql-indent-3 {
	  padding-left: 0px !important;
	  text-indent: 3em !important;
	}
	
	.ql-indent-4 {
	  padding-left: 0px !important;
	  text-indent: 4em !important;
	}
	
	.ql-indent-5 {
	  padding-left: 0px !important;
	  text-indent: 5em !important;
	}
	
	.ql-indent-6 {
	  padding-left: 0px !important;
	  text-indent: 6em !important;
	}
	
	.ql-indent-7 {
	  padding-left: 0px !important;
	  text-indent: 7em !important;
	}
	
	.ql-indent-8 {
	  padding-left: 0px !important;
	  text-indent: 8em !important;
	}
</style>
<style lang="scss" scoped>
	.newsTit{
		font-size: 32rpx;
		color: $pss-text-color0;
		font-weight: 600;
		padding: 15rpx 0;
	}
	.content{
		font-size: 28rpx;
		color: $pss-text-color0;
		height: auto;
		padding: 0 !important;
	}
	.comMod{
		font-size: 26rpx;
		color: $pss-text-color8;
		&.addTime{
			margin-bottom: 20rpx;
		}
		&.viewNum{
			margin-top: 15rpx;
			padding-bottom: 30rpx;
			text-align: right;
		}
	}
</style>